package com.sws.device.domain;

import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sws.common.annotation.Excel;
import com.sws.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 设备信息对象 stu_dev_device
 * 
 * @author ruoyi
 * @date 2025-06-12
 */
@ApiModel(description = "设备信息对象，包含设备的基本信息和状态")
public class DevDevice extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @ApiModelProperty(value = "设备的唯一ID", example = "1")
    private Long id;

    /** 设备序列号(逻辑主键) */
    @Excel(name = "设备序列号")
    @ApiModelProperty(value = "设备序列号，作为逻辑主键", example = "DEV20250101001")
    private String sn;

    /** 设备的局域网IP地址 */
    @Excel(name = "设备的局域网IP地址")
    @ApiModelProperty(value = "设备的IP地址", example = "192.168.1.100")
    private String ip;

    /** 设备部署位置 */
    @Excel(name = "设备部署位置")
    @ApiModelProperty(value = "设备部署的位置描述", example = "一号楼大厅")
    private String location;

    /** 鉴权令牌 */
    @Excel(name = "鉴权令牌")
    @ApiModelProperty(value = "设备鉴权令牌", example = "eyJhbGciOiJIUzI1NiJ9...")
    private String token;

    /** token有效期结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "token有效期结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "鉴权令牌的有效期结束时间", example = "2025-12-31 23:59:59")
    private LocalDateTime tokenExpireTime;

    /** 心跳间隔(秒) */
    @Excel(name = "心跳间隔(秒)")
    @ApiModelProperty(value = "设备心跳间隔，单位秒", example = "10")
    private Long heartbeatInterval;

    /** UNIX时间戳，单位：秒 */
    @Excel(name = "UNIX时间戳，单位：秒")
    @ApiModelProperty(value = "UNIX时间戳，单位秒", example = "1640966400")
    private Long ts;

    /** 上一次心跳的北京时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上一次心跳的北京时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "设备上一次心跳的时间（北京时间）", example = "2025-10-01 12:00:00")
    private LocalDateTime eventTime;

    /** 设备状态0:正常 1:异常 */
    @Excel(name = "设备状态", readConverterExp = "0=正常,1=异常")
    @ApiModelProperty(value = "设备状态，0表示正常，1表示异常", example = "0")
    private String devStatus;

    /** 删除标志(0:正常 1:删除) */
    @ApiModelProperty(value = "删除标志，0表示正常，1表示已删除", example = "0")
    private String delFlag;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setSn(String sn) 
    {
        this.sn = sn;
    }

    public String getSn() 
    {
        return sn;
    }

    public void setIp(String ip) 
    {
        this.ip = ip;
    }

    public String getIp() 
    {
        return ip;
    }

    public void setLocation(String location) 
    {
        this.location = location;
    }

    public String getLocation() 
    {
        return location;
    }

    public void setToken(String token) 
    {
        this.token = token;
    }

    public String getToken() 
    {
        return token;
    }

    public void setTokenExpireTime(LocalDateTime tokenExpireTime) 
    {
        this.tokenExpireTime = tokenExpireTime;
    }

    public LocalDateTime getTokenExpireTime() 
    {
        return tokenExpireTime;
    }

    public void setHeartbeatInterval(Long heartbeatInterval) 
    {
        this.heartbeatInterval = heartbeatInterval;
    }

    public Long getHeartbeatInterval() 
    {
        return heartbeatInterval;
    }

    public void setTs(Long ts) 
    {
        this.ts = ts;
    }

    public Long getTs() 
    {
        return ts;
    }

    public void setEventTime(LocalDateTime eventTime) 
    {
        this.eventTime = eventTime;
    }

    public LocalDateTime getEventTime() 
    {
        return eventTime;
    }

    public void setDevStatus(String devStatus) 
    {
        this.devStatus = devStatus;
    }

    public String getDevStatus() 
    {
        return devStatus;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("sn", getSn())
            .append("ip", getIp())
            .append("location", getLocation())
            .append("token", getToken())
            .append("tokenExpireTime", getTokenExpireTime())
            .append("heartbeatInterval", getHeartbeatInterval())
            .append("ts", getTs())
            .append("eventTime", getEventTime())
            .append("devStatus", getDevStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
